package com.hsmw.domain;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hsmw.common.base.BaseModel;
import com.hsmw.domain.vo.ForemanCountVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 项目表
 * </p>
 *
 * @author WD
 * @since 2021-01-25
 */

@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@ToString
@AllArgsConstructor
@Builder
@TableName("hsmw_item")
@ApiModel(value = "HsmwItem对象", description = "项目表")
public class HsmwItem extends BaseModel {

	private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "施工单位id")
	private String constructionUnitId;

	@ApiModelProperty(value = "施工单位名字")
	private String constructionUnitName;

	@ApiModelProperty(value = "施工单位名字集合 查询使用")
	@TableField(exist = false)
	private List<String> constructionUnitNames;

	private Boolean flag;

	@ApiModelProperty(value = "编号")
	private String sn;

	@ApiModelProperty(value = "项目名称")
	private String name;

	@ApiModelProperty(value = "预计方量")
	private String estimateVolume;


	@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	@ApiModelProperty(value = "施工开始时间")
	private LocalDate startTime;


	@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	@ApiModelProperty(value = "施工结束时间")
	@TableField(updateStrategy = FieldStrategy.IGNORED )
	private LocalDate endTime;

	@ApiModelProperty(value = "项目平面图")
	private String planarGraph;

	@ApiModelProperty(value = "项目位置名称")
	private String position;



	@ApiModelProperty(value = "项目位置详情")
	private String positionDetail;


	@ApiModelProperty(value = "经度")
	private String lng;

	@ApiModelProperty(value = "纬度")
	private String lat;

	@ApiModelProperty(value = "工长id的集合")
	@TableField(exist = false)
	private List<String> forceManIdList;


	@ApiModelProperty(value = "施工时长")
	@TableField(exist = false)
	private Long constructionTime;

	@ApiModelProperty(value = "审核状态")
	private String auditStatus;

	@ApiModelProperty(value = "项目识别码")
	private String itemIdentifyNum;

	@ApiModelProperty(value = "项目状态 0 进行中 1 已完成")
	private String itemStatus;

	@ApiModelProperty(value = "是否当前项目")
	private String isCurrent;

	@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	@ApiModelProperty(value = "审核通过时间")
	private LocalDateTime auditSuccessTime;

	@ApiModelProperty(value = "指定车辆单位ID")
	private String vehicleUnitId;


	@ApiModelProperty(value = "指定车辆单位名称")
	private String vehicleUnitName;

	@ApiModelProperty(value = "审核拒绝备注")
	private String remark;

	@ApiModelProperty(value = "是否混凝土叫车 0  是否 1 是")
	private String ifSelfChoose;

	@ApiModelProperty(value = "结算单价")
	private String settlementPrice;

	@ApiModelProperty("项目所在省份")
	private String itemProvince;

	@ApiModelProperty("项目所在城市")
	private String	itemCity;

	@ApiModelProperty("项目所在县区")
	private String itemCounty;

	@ApiModelProperty(value = "距离位置")
	@TableField(exist = false)
	private Long distance;

	@ApiModelProperty(value = "持续天数")
	@TableField(exist = false)
	private long continusDays;


	@ApiModelProperty(value = "工长数量")
	@TableField(exist = false)
	private long forcemanCount;


	@ApiModelProperty(value = "合计浇铸方量数")
	@TableField(exist = false)
	private double volumeSum;

	@ApiModelProperty(value = "查询参数 司机姓名或者车牌号")
	@TableField(exist = false)
	String queryParam;


	@ApiModelProperty(value = "租赁公司名称")
	@TableField(exist = false)
	List<HsmwLeasingCompany> leasingCompanies;

	@ApiModelProperty("创建人手机号")
	@TableField(exist = false)
	private String userPhone;

	@ApiModelProperty("创建人姓名")
	@TableField(exist = false)
	private String createName;

	@ApiModelProperty("订单数量")
	@TableField(exist = false)
	private int orderNum;

	@ApiModelProperty("工长姓名")
	@TableField(exist = false)
	private String fmName;

	@ApiModelProperty("累计方量")
	@TableField(exist = false)
	private String realTimeVolume;

	@ApiModelProperty(value = "工长id的集合")
	@TableField(exist = false)
	private List<HsmwUser> forceManList;

	@ApiModelProperty(value = "工长方量统计的集合")
	@TableField(exist = false)
	private List<ForemanCountVO> forceManCountList;


	@ApiModelProperty(value = "工长方量统计的集合")
	@TableField(exist = false)
	private List<HsmwItemConcreteRelation> relations;

	@ApiModelProperty(value = "工长信息")
	@TableField(exist = false)
	private HsmwUser foremanUserInfo;


	@ApiModelProperty(value = "工长ID")
	@TableField(exist = false)
	private String foremanUserId;

	@ApiModelProperty(value = "搅拌站名称")
	@TableField(exist = false)
	private String plantName;

	@ApiModelProperty(value = "是否含有邀请中的搅拌站")
	@TableField(exist = false)
	private Integer hasInvitingPlant;


	@ApiModelProperty(value = " 角色类型 0 是工长 1。 负责人。")
	@TableField(exist = false)
	private String roleType;

}
